// console.log(" hello, world! ")
// let age = 25;
// age = 26
// const pi = 3.14
// // pi = 3.1415

// console.log("age: ", age)
// console.log("pi:", pi)

// let myName = "Mather" //my_name 

let email = "mather@google.com"
console.log(email)

let fristName = "Brandon"
let LastName = "Sanderson"

//let fullName = fristName + " " + LastName
let fullName = `${ fristName } ${ LastName }`

console.log(fullName)

//获取第三个字
console.log(fullName[2]) // 0 1 2 

//字符长度
console.log(fullName.length)

//字符串内置函数
console.log(fullName.toUpperCase())
let result = fullName.toLowerCase()

console.log(result)

//let index = email.indexOf("@") 

//lastIndexOf
let index = email.lastIndexOf("g") 
console.log(index)


//截取字符串 slice(start, end)
let res = email.slice(0, 6)
console.log(res)

//截取字符串 substr(start, length)
let substr_email = email.substr(2, 7)
console.log(substr_email)

//替换字符串
let replace_email = email.replace("google", "baidu")
console.log(replace_email)